package it.polimi.travelDream.web.beans;

import it.polimi.it.TravelDream.ejb.UserMgr;
import it.polimi.it.TravelDream.ejb.eaos.UserDTO;

import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

@ManagedBean
@RequestScoped
public class UserBean {
	
	@EJB
	private UserMgr userMgr;
	
	private UserDTO newUser;
	
	
	public UserDTO getNewUser() {
		return newUser;
	}

	public void setNewUser(UserDTO newUser) {
		this.newUser = newUser;
	}

	//restituisce il nome del DTO
	public String getName() {
		return userMgr.getUserDTO().getFirstName();
	}
	
	public UserMgr getUserMgr() {
		return userMgr;
	}

	public void setUserMgr(UserMgr userMgr) {
		this.userMgr = userMgr;
	}
	
	
	
}
